<!DOCTYPE html>
<head>
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  <style type="text/css">
    html{height:80%}
    body{height:80%;margin:10px;padding:100px}
    #container{height:100%}
  </style>
  <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=uTRuIg9jYtXND9Pw4MoDqfGnZ60ZRcPy">
  </script>
</head>
<body>
<div id="container"></div>
<script type="text/javascript">
  var map = new BMapGL.Map("container");
  var point = new BMapGL.Point(98.765039, 25.462551);
  map.centerAndZoom(point, 15);
  map.enableScrollWheelZoom(true);
  var scaleCtrl = new BMapGL.ScaleControl();  // 添加比例尺控件
  map.addControl(scaleCtrl);
  var zoomCtrl = new BMapGL.ZoomControl();  // 添加缩放控件
  map.addControl(zoomCtrl);
  var cityCtrl = new BMapGL.CityListControl();  // 添加城市列表控件
  map.addControl(cityCtrl);
  map.setMapType(BMAP_EARTH_MAP);      // 设置地图类型为地球模式
  var map = new BMapGL.Map("container");
  map.centerAndZoom(new BMapGL.Point(116.404, 39.915), 11);

  var p1 = new BMapGL.Point(99.184341,25.105656);
  var p2 = new BMapGL.Point(98.765039, 25.462551);

  var driving = new BMapGL.DrivingRoute(map, {renderOptions:{map: map, autoViewport: true}});
  driving.search(p1, p2);
</script>
</body>
